<?php

class All extends TPage
{
    private $backupManager;
	public $count;
    
	public function onLoad($params)
	{
		parent::onLoad($params);
        $this -> backupManager = $this -> Application -> Modules['backups'];
        
        $page = $this->Application->Request['site'];
		$this->count = $this->backupManager->countBackups();
        
        $this->site_manager->setData(	$this->Page->getPagePath(),
										array(),
										$page,
										$this->count,
										10);
			
		$this->BackupsList->DataSource = $this->backupManager->getBackupsList(
													true,
													$this->site_manager->getOffset(),
													$this->site_manager->getElementsPerSite());
		$this->BackupsList->dataBind();
        
        
	}

	public function deleteButtonClicked($sender, $param)
	{
		$this -> backupManager -> removeBackup($param->CommandParameter);
		$this -> Application -> Response -> reload();
	}
	
	public function restoreButtonClicked($sender, $param)
	{
		$this -> backupManager -> restoreBackup($param->CommandParameter);
		$this -> Application -> Response -> reload();
	}
	
	public function restoreToDefaultsButtonClicked($sender, $param)
	{
		$this -> backupManager -> restoreDefaults();
		//$this -> Application -> Response -> reload();
	}
}

?>